package com.chuyu.jzwboa.activity.testqinmanage;

import android.support.annotation.NonNull;
import android.support.v7.widget.LinearLayoutManager;
import android.view.View;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.chuyu.jzwboa.R;
import com.chuyu.jzwboa.adapter.offmoblie.HitCardRecordAdapter;
import com.chuyu.jzwboa.base.MVPBaseActivity;
import com.chuyu.jzwboa.presenter.testqinmanage.HitCardRecordPresenter;
import com.chuyu.jzwboa.utils.sys.StatusBarUtils;
import com.chuyu.jzwboa.view.iview.testqinmanage.IHitCardRecordView;
import com.jcodecraeer.xrecyclerview.ProgressStyle;
import com.jcodecraeer.xrecyclerview.XRecyclerView;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;

/**
 * 考勤管理----》打卡记录
 */
public class HitCardRecordActivity extends MVPBaseActivity<IHitCardRecordView, HitCardRecordPresenter> implements IHitCardRecordView, View.OnClickListener {

	@BindView(R.id.iv_cancel)
	ImageView ivCancel;
	@BindView(R.id.tv)
	TextView tv;
	@BindView(R.id.line)
	View line;
	@BindView(R.id.tv_time)
	TextView tvTime;
	@BindView(R.id.rl_selecter_time)
	RelativeLayout rlSelecterTime;
	@BindView(R.id.hitvard_recyclerview)
	XRecyclerView hitvardRecyclerview;
	@BindView(R.id.rl_hitcard)
	RelativeLayout rlHitcard;
	private HitCardRecordPresenter hitCardRecordPresenter;
	private HitCardRecordAdapter hitCardRecordAdapter;

	@NonNull
	@Override
	public HitCardRecordPresenter createPresenter() {
		hitCardRecordPresenter = new HitCardRecordPresenter();
		return hitCardRecordPresenter;
	}

	@Override
	protected int initContent() {
		return R.layout.activity_hit_card_record;
	}

	@Override
	protected void initView() {
		ivCancel.setOnClickListener(this);
		rlSelecterTime.setOnClickListener(this);
		LinearLayoutManager layoutManager = new LinearLayoutManager(this);
		layoutManager.setOrientation(LinearLayoutManager.VERTICAL);
		hitvardRecyclerview.setLayoutManager(layoutManager);
		hitvardRecyclerview.setRefreshProgressStyle(ProgressStyle.BallSpinFadeLoader);

	}

	@Override
	protected void initData() {
		/**
		 * 动态设置状态栏高度
		 */
		int statusHeight = StatusBarUtils.getStatusHeight(this);
		rlHitcard.setPadding(0, statusHeight, 0, 0);
		List<Integer> list = new ArrayList<>();
		list.add(1);
		list.add(1);
		list.add(1);
		hitCardRecordAdapter = new HitCardRecordAdapter(getApplicationContext(), list);
		hitvardRecyclerview.setAdapter(hitCardRecordAdapter);
	}

	@Override
	public void LoadSuccess() {

	}

	@Override
	public void LoadFailed() {

	}

	@Override
	public void LoadException() {

	}

	@Override
	public void onClick(View view) {
		switch (view.getId()) {
			case R.id.iv_cancel:
				finish();
				break;
			case R.id.rl_selecter_time:
				break;
		}
	}

}
